package com.ansion.commonchat.startup.workmanager.bwork.impl.mode;

import androidx.annotation.NonNull;

import com.ansion.commonchat.startup.workmanager.bwork.listener.BWorkListener;

import java.util.Collections;
import java.util.List;


/**
 * Created by wanghongjie on 2023/7/18
 * Describe :  表结构类，这是自定义的一个表， WorkManager 并不存在。
 * <p>
 * 用于记录哪些 work 被监听，存储被监听的work及监听者，目前仅用于状态变更时，遍历通知对应监听者。
 * <p>
 * 后续待扩展...
 */
public class BWorkCallback {

    @NonNull
    public final List<String> workIds;

    @NonNull
    public final BWorkListener listener;

    public BWorkCallback(@NonNull String workId, @NonNull BWorkListener listener) {
        this.workIds = Collections.singletonList(workId);
        this.listener = listener;
    }

    public BWorkCallback(@NonNull List<String> workIds, @NonNull BWorkListener listener) {
        this.workIds = workIds;
        this.listener = listener;
    }
}